package bubbleSort;

import emergent.Agent;
import emergent.Monitor;
import emergent.World;

public class Number extends Agent {

	private int numberValue;
	private Number[][] agents;

	public Number[][] getAgents() {
		return agents;
	}

	public void setAgents(Number[][] agents) {
		this.agents = agents;
	}

	public int getNumberValue() {
		return numberValue;
	}

	public void setNumberValue(int numberValue) {
		this.numberValue = numberValue;
	}

	public Number(int id, Monitor supervisor, boolean sync,
			int procrastination, int value) {
		super(id, supervisor, sync, procrastination);
		this.numberValue = value;
	}

	public Number(int id, Monitor supervisor, boolean sync,
			boolean useRandomDelay, int min, int max, int value) {
		super(id, supervisor, sync, useRandomDelay, min, max);
		this.numberValue = value;
	}

	public Number(int id, Monitor supervisor, boolean sync, int value) {
		super(id, supervisor, sync);
		this.numberValue = value;
	}

	public Number getBottomSideAgent() {
		if (myRow + 2 > supervisor.getWorld().getMaxRows()) {
			return null;
		}
		// System.out.println("R R:"+myRow + "C:" + myColumn);
		return (agents[myRow + 1][myColumn]);
	}

	public Number getRightHandSideAgent() {
		if (myColumn + 2 > supervisor.getWorld().getMaxColumns()) {
			return null;
		}
		// System.out.println("B R:"+myRow + "C:" + myColumn);
		return (agents[myRow][myColumn + 1]);
	}

	@Override
	public String toString() {
		return (" " + numberValue + " ");
	}
}
